import * as type from './type.js';
 
const defaultState = {
  testmsg: 'hahah',
}
 
/*
  @state=defaultState:默认store定义值
  @action:通过dispatch需要改变得值
  @CHANGE_INPUT: input框change事件，改变得value与inputVal绑定
  @ADD_ITEM: 点击提交按钮，将inputVal放入li中
  @DEL_ITEM: 点击哪个li删除哪个
*/
export default (state = defaultState, action) => {
  let newState = JSON.parse(JSON.stringify(state))
 
  switch (action.type) {
    case type.BASE_test_data:
      console.log("aaaaaa", newState)
      console.log("bbbbb", action)
      newState.testmsg = action.payload
      break;
    default:
      return state
      break;
  }
  return newState
}